<template>
	<view>
		<view class="header">
			<view class="back" @click="goBack">
				<van-icon name="arrow-left" color="#157ef9" />
				<text>返回</text>
			</view>
			<view class="title">收入纳税明细详情</view>
			<view class="handle" @click="appeal">申诉</view>
		</view>
		<view class="main">
			<cu-card title="纳税明细信息">
				<template v-slot:region>
					<view class="cell-group">
						<view class="cell">
							<view class="cell-left">
								收入：
							</view>
							<view class="cell-right">
								190000.00元
							</view>
						</view>
						<view class="cell">
							<view class="cell-left">
								已申报税额：
							</view>
							<view class="cell-right">
								1123232.54元
							</view>
						</view>
						<view class="show-count">
							<span @click="showCount">
								<text>查看税款计算</text>
								<van-icon name="arrow" />
							</span>
						</view>
					</view>
				</template>
			</cu-card>
			<cu-card title="纳税明细-基础情况">
				<template v-slot:region>
					<view class="cell-group">
						<view class="cell">
							<view class="cell-left">
								所得项目小类：
							</view>
							<view class="cell-right">
								正常工资薪金
							</view>
						</view>
						<view class="cell">
							<view class="cell-left">
								扣缴义务人名称：
							</view>
							<view class="cell-right">
								北京中软国际科技服务有限公司
							</view>
						</view>
						<view class="cell">
							<view class="cell-left">
								扣缴义务人纳税人识别号：
							</view>
							<view class="cell-right">
								1102232432432432
							</view>
						</view>
						<view class="cell">
							<view class="cell-left">
								主管税务机关：
							</view>
							<view class="cell-right">
								国家税务总局北京市海淀区税务局
							</view>
						</view>
						<view class="cell">
							<view class="cell-left">
								申报渠道：
							</view>
							<view class="cell-right">
								其他
							</view>
						</view>
					</view>
				</template>
			</cu-card>
			<cu-card :isShowTitle="false">
				<template v-slot:region>
					<view class="cell-group">
						<view class="cell">
							<view class="cell-left">
								申报日期：
							</view>
							<view class="cell-right">
								2024-01-03
							</view>
						</view>
						<view class="cell">
							<view class="cell-left">
								税款所属期：
							</view>
							<view class="cell-right">
								2024-01-03
							</view>
						</view>
					</view>
				</template>
			</cu-card>
			<cu-card title="本期收入与扣除详情">
				<template v-slot:tips>
					<view class="tip">
						温馨提示：专项附加扣除和个人养老金已体现在税款计算过程中，在本期数据中不予显。您可在“税款计算-累计收入与扣款详情”中查看。
						<text @click="showCount">查看税款计算</text>
					</view>
				</template>
				<template v-slot:region>
					<view class="cell-group cell-group-type">
						<view class="cell">
							<view class="cell-left">
								本期收入：
							</view>
							<view class="cell-right">
								2323232元
							</view>
						</view>
						<view class="cell">
							<view class="cell-left">
								本期免税收入：
							</view>
							<view class="cell-right">
								0.00元
							</view>
						</view>
						<view class="cell">
							<view class="cell-left">
								本期减除费用：
							</view>
							<view class="cell-right">
								0.00元
							</view>
						</view>
						<!-- <view class="cell">
							<view class="cell-left">
								本期专项扣除：
							</view>
							<view class="cell-right">
								0.00元
							</view>
						</view> -->
						<van-collapse v-model="activeName" accordion :border="false">
							<van-collapse-item name="1" :border="false">
								<template #title>
									<span class="collapse-title">本期专项扣除：</span>
								</template>
								<template #default>
									<view class="collapse-content">
										<span class="collapse-content-left">基本养老保险</span>
										<span class="collapse-content-right">323.43元</span>
									</view>
									<view class="collapse-content">
										<span class="collapse-content-left">基本医疗保险</span>
										<span class="collapse-content-right">323.43元</span>
									</view>
									<view class="collapse-content">
										<span class="collapse-content-left">失业保险</span>
										<span class="collapse-content-right">323.43元</span>
									</view>
									<view class="collapse-content">
										<span class="collapse-content-left">住房公积金</span>
										<span class="collapse-content-right">323.43元</span>
									</view>
								</template>
								<template #value>
									<span class="collapse-val">1234234.43元</span>
								</template>
							</van-collapse-item>
						</van-collapse>
						<view class="cell" style="padding-top: 0rpx;">
							<view class="cell-left">
								本期其他扣除：
							</view>
							<view class="cell-right">
								0.00元
							</view>
						</view>
						<view class="cell">
							<view class="cell-left">
								本期准予扣除的捐赠项目：
							</view>
							<view class="cell-right">
								0.00元
							</view>
						</view>
					</view>
				</template>
			</cu-card>
		</view>
	</view>
</template>

<script setup lang='ts'>
	import {
		ref
	} from 'vue';
	import {
		showToast
	} from 'vant';
	const goBack = () => {
		uni.redirectTo({
			url: "/pages/detail/list"
		})
	}
	const appeal = () => {
		showToast({
			message: '批量申诉',
			icon: 'like-o',
		});
	}
	const showCount = () => {
		uni.navigateTo({
			url: "/pages/detail/count"
		})
	}
	const activeName = ref('')
</script>

<style scoped lang='scss'>
	.header {
		width: 100%;
		position: fixed;
		top: 0;
		left: 0;
		background-color: #fff;
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 0rpx 32rpx;
		box-sizing: border-box;
		height: 88rpx;
		z-index: 999;

		.back {
			display: flex;
			align-items: center;

			text {
				font-size: 28rpx;
				color: #157ef9;
			}
		}

		.title {
			font-size: 32rpx;
			font-weight: bold;
		}

		.handle {
			font-size: 28rpx;
			color: #157ef9;
		}
	}

	.main {
		position: relative;
		top: 88rpx;
		padding-bottom: 200rpx;

		.cell-group {
			padding-bottom: 20rpx;

			.cell {
				width: 100%;
				display: flex;
				justify-content: space-between;
				align-items: flex-start;
				padding: 20rpx 32rpx 0rpx 32rpx;
				box-sizing: border-box;
				font-size: 28rpx;

				.cell-left {
					color: #99989e;
					width: 35%;
				}

				.cell-right {
					color: #343434;
					width: 60%;
					text-align: right;

				}
			}

			.show-count {
				display: flex;
				justify-content: flex-end;
				align-items: center;
				color: #157ef9;
				padding: 20rpx 32rpx 0rpx 32rpx;
				box-sizing: border-box;
				font-size: 28rpx;
			}

			.collapse-title {
				color: #99989e;
			}

			.collapse-val {
				color: #343434;
			}

			.collapse-content {
				display: flex;
				justify-content: space-between;
				background-color: #f9fafd;
				padding: 20rpx 68rpx 20rpx 64rpx;
				box-sizing: border-box;

				&:last-child {
					padding-bottom: 20rpx;
				}

				.collapse-content-left {
					color: #99989e;
				}

				.collapse-content-right {
					color: #343434;
				}
			}
		}

		.cell-group-type {
			.cell {
				.cell-right {
					padding-right: 36rpx;
				}
			}
		}

		.tip {
			width: 100%;
			background-color: #ebf4fd;
			padding: 20rpx 32rpx;
			box-sizing: border-box;
			font-size: 24rpx;
			color: #333;

			text {
				color: #157ef9;
			}
		}
	}

	:deep(.van-collapse) {
		.van-collapse-item {
			.van-collapse-item__wrapper {
				.van-collapse-item__content {
					padding: 0rpx 0rpx 20rpx 0rpx;
				}
			}
		}
	}
</style>